package com.example.mybatisplustest.service.serviceImpl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mybatisplustest.entity.MyOrder;
import com.example.mybatisplustest.mapper.MyOrderMapper;
import com.example.mybatisplustest.service.MyOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author w5cSchool
 * @date 2021/11/5 23:28
 * description:
 */
@Service
public class MyOrderImpl implements MyOrderService {
    @Resource
    MyOrderMapper myOrderMapper;


    @DS("master")
    public MyOrder index(){
        QueryWrapper<MyOrder> wrapper = new QueryWrapper<>();
        wrapper.eq("id","101");
        MyOrder myOrder = myOrderMapper.selectOne(wrapper);
        return myOrder;
    }
}
